import Core from "./Core";
import * as VuePropertyDecorator from "vue-property-decorator";
import VueAwesomeSwiper from "vue-awesome-swiper";
import VueRouter from "vue-router";
import Vue from "vue";
import Vuex from "vuex";
// import VueAntd from "vue-antd";
import ElementUi from "element-ui";
import Echarts from "echarts";
import "element-ui/lib/theme-chalk/index.css";
import Lazyload from "vue-lazyload";
import lazyLoadImage from "assets/global/loadbg.png";

export class VueComponent extends VuePropertyDecorator.Vue {
  public netWork      = Core.Network;
  public router       = Core.Router;
  public constructor(options: any = null) {
    super(options);
    // 设置路由对象
    options && this.router.setRouter(options.router);
    options && this.router.setStore(options.store);
    options && this.router.initialize();
  }
}

Vue.use(Lazyload as any, {
  preLoad: 1.3,
  error: lazyLoadImage,
  loading: lazyLoadImage,
  attempt: 1,
});
Vue.use(VueRouter);
Vue.use(Vuex);
// Vue.use(VueAntd);
Vue.use(VueAwesomeSwiper as any /* { default global options } */);
Vue.use(ElementUi);
Vue.use(Echarts);

export const Network      = Core.Network;
export const RouterManage = Core.Router;
export const Prop         = VuePropertyDecorator.Prop;
export const Watch        = VuePropertyDecorator.Watch;
export const Component    = VuePropertyDecorator.Component;
export const Router       = VueRouter;
